/*
 *
 */
package org.opu.translator;

import java.util.regex.Pattern;

/**
 *  rule of scaning
 * @author yura
 */
public class Rule {

    /** name of rule */
    public final String name;

    /** rule pattern */
    public final Pattern pattern;

    /**
     *
     * @param name name of rule
     * @param regex rule pattern
     */
    public Rule(String name, String regex) {
        this.name = name;
        this.pattern = Pattern.compile(regex);
    }

    @Override
    public String toString() {
        return name + "=\"" + pattern + "\"";
    }
}
